package com.sj.purchase.modules.cost.repository;

import com.sj.purchase.modules.cost.domain.SucTask;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.Date;
import java.util.List;

public interface SucTaskRepository extends CrudRepository<SucTask,Long> {

    SucTask findByTaskTypeAndTaskDay(SucTask.TaskType taskType, Date taskDay);

    @Query("SELECT o FROM SucTask o WHERE o.taskDay BETWEEN ?1 AND ?2")
    List findByTaskDayBetweenAndTaskDay(Date begin,Date end);

    Long countByTaskDay(Date taskDay);
}
